package de.dpunkt.myaktion.util;

import java.util.logging.Logger;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.faces.context.FacesContext;

import de.dpunkt.myaktion.util.qualifier.FachLog;
import de.dpunkt.myaktion.util.qualifier.TechLog;

public class Resources {
	
//   public final static String ENTITY_MANAGER_JNDI_NAME = "java:/MyAktionEntityManager";
//   
//   @Produces
//   @PersistenceContext(unitName="my-aktion")
//   private EntityManager em;
  
   @Produces
   @FachLog
   public Logger produceFachLog(InjectionPoint injectionPoint) {
      return Logger.getLogger("FachLog: " + injectionPoint.getMember().getDeclaringClass().getName());
   }
   
   @Produces
   @TechLog
   public Logger produceTechLog(InjectionPoint injectionPoint) {
      return Logger.getLogger("TechLog: " + injectionPoint.getMember().getDeclaringClass().getName());
   }

   @Produces
   @RequestScoped
   public FacesContext produceFacesContext() {
      return FacesContext.getCurrentInstance();
   }
}
